#a{grid-area:a;}
#b{grid-area:b;}
#c{grid-area:c;}
#d{grid-area:d;}
#e{grid-area:e;}

#grid{
    display: grid;
    grid-template-areas: 
    "a a a a"
    "b c d e";
}

@media(max-width:512px){
    #grid{
        grid-template-areas:
        "a a a"
        "b c d"
        "e e e" 
    }
}